<template>
    <div class='grandSon'>
        this is grandSon 
        {{name}}
        {{price}}
    </div>
</template>

<script>
    import {inject, toRefs} from 'vue'
    export default {
        name : "GrandSon",
        setup(){
            // 用inject可以很方便的接收到数据
            let car = inject("car")
            return {
                car,
                ...toRefs(car)
            }
        }
    }
</script>

<style scoped>
    .grandSon{
        background-color: #6bbad6;
        padding:10px;
        margin:10px;
    }
</style>